<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.virtualmall.common.Constants"%>
<%
    if(session.getAttribute(Constants.USER_ID_SESSION) != null){
%>
<div class="fixTools">
	您好！&nbsp;&nbsp;欢迎回来xx商城！
	<a href="<%=request.getContextPath() %>/account/logout">退出</a>
</div>
<%       
    }
%>
<div class="header">
    <h1 class="logo"><img src="<%=request.getContextPath() %>/style/images/logo.png" alt="xx商城" /></h1>
    <form action="<%=request.getContextPath() %>/product/search">
	    <div class="searchBar">
	        <input type="text" name="keyword" class="searchTxt" />
	        <input type="submit" value="搜索" class="searchBtn" />
	    </div>
    </form>
<%
    if(session.getAttribute(Constants.USER_ID_SESSION) != null){
%>
    <div class="cart">
                            购物车中还有 <strong class="c_red" id="shoppingCartCountInMenu">0</strong>件商品 <br />
                            合计 <strong class="c_red" id="shoppingCartTotalPriceInMenu">0</strong>元
          <a href="javascript:void(0);" onclick="location.href='<%=request.getContextPath() %>/home?func=shoppingCart'" class="tobuyBtn"></a>
    </div>
	<script type="text/javascript">
	    account.getAccountStatisticsInfo();
	</script>
<%       
    }
%>
</div>
<ul class="nav">
    <li id="indexMenu"><a href="<%=request.getContextPath() %>">首页</a></li>
	<li id="promotionsMenu"><a href="<%=request.getContextPath() %>/promotions">优惠活动</a></li>
	<li id="beginnerGuideMenu"><a href="<%=request.getContextPath() %>/beginnerGuide">新手指南</a></li>
</ul>
<script type="text/javascript">
    var currentUrl = location.href;
    if(currentUrl.indexOf("promotions")>0){
        $('#promotionsMenu').addClass('selected');
    }else if(currentUrl.indexOf("beginnerGuide")>0){
        $('#beginnerGuideMenu').addClass('selected');
    }else{
        $('#indexMenu').addClass('selected');
    }
</script>